package com.frinder.admin.web;

import com.frinder.base.global.Result;
import com.frinder.base.global.ResultGenerator;
import com.frinder.data.domain.service.IMapCellsService;
import com.frinder.data.service.BizMapCellsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName MapController
 * @Description 地图服务类
 * @Author frinder
 * @Date 2019/9/27 13:43
 * @Verion 1.0
 */
@RestController
@RequestMapping("/map")
public class MapController {

    @Autowired
    private IMapCellsService mapCellsService;

    @Autowired
    private BizMapCellsService bizMapCellsService;

    @ApiOperation("加载地图格子")
    @GetMapping("/loadMapCells")
    public Result loadMapCells() {
        return ResultGenerator.genSuccessResult(mapCellsService.findAll());
    }

    @ApiOperation("根据路径加载地图格子")
    @GetMapping("/loadMapCellsByPath")
    public Result loadMapCellsByPath() {
        return ResultGenerator.genSuccessResult(bizMapCellsService.loadMapCells());
    }

}
